home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / ImageCodec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  7.1 KB  |  241 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ImageCodec.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __IMAGECODEC__
  18. #define __IMAGECODEC__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __QUICKDRAW__
  27. #include <Quickdraw.h>
  28. #endif
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <QuickdrawText.h>                                    */
  31.  
  32. #ifndef __QDOFFSCREEN__
  33. #include <QDOffscreen.h>
  34. #endif
  35. /*    #include <Errors.h>                                            */
  36.  
  37. #ifndef __WINDOWS__
  38. #include <Windows.h>
  39. #endif
  40. /*    #include <Memory.h>                                            */
  41. /*    #include <Events.h>                                            */
  42. /*        #include <OSUtils.h>                                    */
  43. /*    #include <Controls.h>                                        */
  44. /*        #include <Menus.h>                                        */
  45.  
  46. #ifndef __IMAGECOMPRESSION__
  47. #include <ImageCompression.h>
  48. #endif
  49. /*    #include <Components.h>                                        */
  50. /*    #include <StandardFile.h>                                    */
  51. /*        #include <Dialogs.h>                                    */
  52. /*            #include <TextEdit.h>                                */
  53. /*        #include <Files.h>                                        */
  54.  
  55. #ifndef __MOVIES__
  56. #include <Movies.h>
  57. #endif
  58. /*    #include <Aliases.h>                                        */
  59. /*        #include <AppleTalk.h>                                    */
  60.  
  61. #ifdef __cplusplus
  62. extern "C" {
  63. #endif
  64.  
  65. #if GENERATINGPOWERPC
  66. #pragma options align=mac68k
  67. #endif
  68.  
  69. #ifdef __CFM68K__
  70. #pragma lib_export on
  71. #endif
  72.  
  73.  
  74. enum {
  75.     codecGetCodecInfo            = 0x00,
  76.     codecGetCompressionTime        = 0x01,
  77.     codecGetMaxCompressionSize    = 0x02,
  78.     codecPreCompress            = 0x03,
  79.     codecBandCompress            = 0x04,
  80.     codecPreDecompress            = 0x05,
  81.     codecBandDecompress            = 0x06,
  82.     codecCDSequenceBusy            = 0x07,
  83.     codecGetCompressedImageSize    = 0x08,
  84.     codecGetSimilarity            = 0x09,
  85.     codecTrimImage                = 0x0A,
  86.     codecRequestSettings        = 0x0B,
  87.     codecGetSettings            = 0x0C,
  88.     codecSetSettings            = 0x0D,
  89.     codecCDSequenceFlush        = 0x0E,
  90.     codecSetTimeCode            = 0x0F
  91. };
  92.  
  93. enum {
  94.     codecCanScale                = 1L << 0,
  95.     codecCanMask                = 1L << 1,
  96.     codecCanMatte                = 1L << 2,
  97.     codecCanTransform            = 1L << 3,
  98.     codecCanTransferMode        = 1L << 4,
  99.     codecCanCopyPrev            = 1L << 5,
  100.     codecCanSpool                = 1L << 6,
  101.     codecCanClipVertical        = 1L << 7,
  102.     codecCanClipRectangular        = 1L << 8,
  103.     codecCanRemapColor            = 1L << 9,
  104.     codecCanFastDither            = 1L << 10,
  105.     codecCanSrcExtract            = 1L << 11,
  106.     codecCanCopyPrevComp        = 1L << 12,
  107.     codecCanAsync                = 1L << 13,
  108.     codecCanMakeMask            = 1L << 14,
  109.     codecCanShift                = 1L << 15,
  110.     codecCanAsyncWhen            = 1L << 16,
  111.     codecCanShieldCursor        = 1L << 17,
  112.     codecCanManagePrevBuffer    = 1L << 18
  113. };
  114.  
  115. struct CodecCapabilities {
  116.     long                            flags;
  117.     short                            wantedPixelSize;
  118.     short                            extendWidth;
  119.     short                            extendHeight;
  120.     short                            bandMin;
  121.     short                            bandInc;
  122.     short                            pad;
  123.     unsigned long                    time;
  124. };
  125. typedef struct CodecCapabilities CodecCapabilities;
  126.  
  127.  
  128. enum {
  129.     codecConditionFirstBand        = 1L << 0,
  130.     codecConditionLastBand        = 1L << 1,
  131.     codecConditionFirstFrame    = 1L << 2,
  132.     codecConditionNewDepth        = 1L << 3,
  133.     codecConditionNewTransform    = 1L << 4,
  134.     codecConditionNewSrcRect    = 1L << 5,
  135.     codecConditionNewMask        = 1L << 6,
  136.     codecConditionNewMatte        = 1L << 7,
  137.     codecConditionNewTransferMode = 1L << 8,
  138.     codecConditionNewClut        = 1L << 9,
  139.     codecConditionNewAccuracy    = 1L << 10,
  140.     codecConditionNewDestination = 1L << 11,
  141.     codecConditionFirstScreen    = 1L << 12,
  142.     codecConditionDoCursor        = 1L << 13,
  143.     codecConditionCatchUpDiff    = 1L << 14,
  144.     codecConditionCodecChangedMask = 1L << 31
  145. };
  146.  
  147. enum {
  148.     codecInfoResourceType        = 'cdci',
  149.     codecInterfaceVersion        = 2
  150. };
  151.  
  152. struct CodecCompressParams {
  153.     ImageSequence                    sequenceID;
  154.     ImageDescriptionHandle            imageDescription;
  155.     Ptr                                data;
  156.     long                            bufferSize;
  157.     long                            frameNumber;
  158.     long                            startLine;
  159.     long                            stopLine;
  160.     long                            conditionFlags;
  161.     CodecFlags                        callerFlags;
  162.     CodecCapabilities                *capabilities;
  163.     ICMProgressProcRecord            progressProcRecord;
  164.     ICMCompletionProcRecord            completionProcRecord;
  165.     ICMFlushProcRecord                flushProcRecord;
  166.     PixMap                            srcPixMap;
  167.     PixMap                            prevPixMap;
  168.     CodecQ                            spatialQuality;
  169.     CodecQ                            temporalQuality;
  170.     Fixed                            similarity;
  171.     DataRateParamsPtr                dataRateParams;
  172.     long                            reserved;
  173. };
  174. typedef struct CodecCompressParams CodecCompressParams;
  175.  
  176. struct CodecDecompressParams {
  177.     ImageSequence                    sequenceID;
  178.     ImageDescriptionHandle            imageDescription;
  179.     Ptr                                data;
  180.     long                            bufferSize;
  181.     long                            frameNumber;
  182.     long                            startLine;
  183.     long                            stopLine;
  184.     long                            conditionFlags;
  185.     CodecFlags                        callerFlags;
  186.     CodecCapabilities                *capabilities;
  187.     ICMProgressProcRecord            progressProcRecord;
  188.     ICMCompletionProcRecord            completionProcRecord;
  189.     ICMDataProcRecord                dataProcRecord;
  190.     CGrafPtr                        port;
  191.     PixMap                            dstPixMap;
  192.     BitMapPtr                        maskBits;
  193.     PixMapPtr                        mattePixMap;
  194.     Rect                            srcRect;
  195.     MatrixRecord                    *matrix;
  196.     CodecQ                            accuracy;
  197.     short                            transferMode;
  198.     ICMFrameTimePtr                    frameTime;
  199.     long                            reserved[1];
  200.     SInt8                            matrixFlags;
  201.     SInt8                            matrixType;
  202.     Rect                            dstRect;
  203. };
  204. typedef struct CodecDecompressParams CodecDecompressParams;
  205.  
  206.  
  207. enum {
  208.     matrixFlagScale2x            = 1L << 7
  209. };
  210.  
  211. extern pascal ComponentResult CDGetCodecInfo(Handle storage, CodecInfo *info);
  212. extern pascal ComponentResult CDGetCompressionTime(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *time);
  213. extern pascal ComponentResult CDGetMaxCompressionSize(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ quality, long *size);
  214. extern pascal ComponentResult CDPreCompress(Handle storage, CodecCompressParams *params);
  215. extern pascal ComponentResult CDBandCompress(Handle storage, CodecCompressParams *params);
  216. extern pascal ComponentResult CDPreDecompress(Handle storage, CodecDecompressParams *params);
  217. extern pascal ComponentResult CDBandDecompress(Handle storage, CodecDecompressParams *params);
  218. extern pascal ComponentResult CDCodecBusy(Handle storage, ImageSequence seq);
  219. extern pascal ComponentResult CDGetCompressedImageSize(Handle storage, ImageDescriptionHandle desc, Ptr data, long bufferSize, ICMDataProcRecordPtr dataProc, long *dataSize);
  220. extern pascal ComponentResult CDGetSimilarity(Handle storage, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
  221. extern pascal ComponentResult CDTrimImage(Handle storage, ImageDescriptionHandle Desc, Ptr inData, long inBufferSize, ICMDataProcRecordPtr dataProc, Ptr outData, long outBufferSize, ICMFlushProcRecordPtr flushProc, Rect *trimRect, ICMProgressProcRecordPtr progressProc);
  222. extern pascal ComponentResult CDRequestSettings(Handle storage, Handle settings, Rect *rp, ModalFilterUPP filterProc);
  223. extern pascal ComponentResult CDGetSettings(Handle storage, Handle settings);
  224. extern pascal ComponentResult CDSetSettings(Handle storage, Handle settings);
  225. extern pascal ComponentResult CDCodecFlush(Handle storage);
  226. extern pascal ComponentResult CDCodecSetTimeCode(Handle storage, void *timeCodeFormat, void *timeCodeTime);
  227.  
  228. #ifdef __CFM68K__
  229. #pragma lib_export off
  230. #endif
  231.  
  232. #if GENERATINGPOWERPC
  233. #pragma options align=reset
  234. #endif
  235.  
  236. #ifdef __cplusplus
  237. }
  238. #endif
  239.  
  240. #endif /* __IMAGECODEC__ */
  241.